<template>
  <DefaultNav />
  <DefaultHeader />
  <DefaultFixedHeader />
  <!-- 添加key,破坏服用机制 -->
  <!-- <RouterView :key="$route.fullPath" /> -->
  <RouterView />
  <DefaultFooter />
</template>

<script setup name="DefaultLayout">
import { onMounted } from 'vue'
import { RouterView } from 'vue-router'
import DefaultHeader from './components/Header.vue'
import DefaultNav from './components/Nav.vue'
import DefaultFooter from './components/Footer.vue'
import DefaultFixedHeader from './components/FixedHeader.vue'

// 触发获取导航列表的action
import { useCategoryStore } from '@/stores/category'
const categoryStore = useCategoryStore()
onMounted(() => {
  categoryStore.getCategory()
})
</script>

<style scoped lang="scss"></style>
